﻿
Imports osi.root.delegates

Namespace queue_runner
    Public Module _queue_runner_repeat
        Public Function repeat(ByVal d As Action, ByRef f As Func(Of Boolean)) As Boolean
            If d Is Nothing Then
                Return False
            Else
                f = Function() As Boolean
                        d()
                        Return True
                    End Function
                Return True
            End If
        End Function

        Public Function repeat(ByVal d As Action) As Func(Of Boolean)
            Dim f As Func(Of Boolean) = Nothing
            assert(repeat(d, f))
            Return f
        End Function
    End Module
End Namespace
